package com.ydc.ln.tutorial.mail.it315;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import sun.misc.BASE64Encoder;

public class Base64Util {
	public static void main(String[] args) throws IOException{
		System.out.println("请输入用户名：");
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String username = in.readLine();
		System.out.println("请输入密码：");
		String password = in.readLine();
		BASE64Encoder encoder = new BASE64Encoder();
		System.out.println("编码后的用户名：" + encoder.encode(username.getBytes()));
		System.out.println("编码后的密码：" + encoder.encode(password.getBytes()));
	}
}
// eWFuZ2RhY2hhbw==
//	eWF5YW5nZGFjaGFvMDAx
//	bmd5YW55YXlub2tpYTIwMDkhI0A=
// 编码后的用户名：Y2gwMDFhb0BxcS5jb20=
// 编码后的密码：Y2hhbzI5NSEjQHFx
// 编码后的用户名：aXQzMTVfdGVzdEBzb2h1LmNvbQ==
// 编码后的密码：MTIzNDU2
/*
1.cmd 
telnet smtp.163.com 25
2.ehlo @name	// 告诉服务器我是谁
3.auth login	// 登录 
4.mail from: 地址
5.rcpt to: 地址
6.data	//写邮件



ehlo yangdachao
auth login
eWF5YW5nZGFjaGFvMDAx
bmd5YW55YXlub2tpYTIwMDkhI0A=
mail from:yangdachao001@163.com
rcpt to:yangdachao001@163.com
*/